﻿import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import "../../js/UI.js" as Style
Rectangle {
    id: rect
    property alias m_headSource: m_head.m_source
    property alias m_name: m_NameText_id.text
    property alias m_online: phonetext.text
    property alias m_visible: imgbottom.visible
    property alias m_muteVisible: imgMute.visible
    color: "transparent"
    width: m_root_id.width
    height: m_lineValue*1.2
    signal menuclickSignal()
    signal persondetailSignal()
    MouseArea{
        anchors.fill: parent
        onClicked: {
            persondetailSignal()
        }
    }
    HeadImage {
        id: m_head
        width: is_PCScreen ? 0.7*parent.height : parent.height*0.8
        height: width
        anchors.left: parent.left
        anchors.leftMargin: m_lineValue*0.4
        anchors.verticalCenter: parent.verticalCenter
        nameText: m_NameText_id.text.substring(0,1)
        colorText:m_NameText_id.text.length>1?m_NameText_id.text.substring(1,2):""
    }
    Item {
        width: m_root_id.width - m_lineValue*2
        anchors.left: m_head.right
        anchors.leftMargin:Qt.platform.os != "ios" ? m_lineValue*0.3 : m_lineValue*0.25
        height:is_PCScreen ? parent.height*0.5 : (Qt.platform.os != "ios" ? parent.height*0.8 : parent.height*0.7)
        anchors.verticalCenter: parent.verticalCenter
        Item{
            height: parent.height*0.5
            width: parent.width
            anchors.left: parent.left
            anchors.top: parent.top
            AText {
                anchors.left: parent.left
                anchors.verticalCenter: parent.verticalCenter
                //anchors.topMargin: phonetext.text===""?(parent.height-paintedHeight)/2:(parent.height/2-paintedHeight)/2
                id: m_NameText_id
                width: parent.width
                font.pointSize:is_PCScreen ? 13 :  16
                font.family: Style.fontfamily
                elide: Text.ElideRight
                wrapMode: Text.NoWrap
            }
        }
        Item{
            height: parent.height*0.5
            width: parent.width
            anchors.left: parent.left
            anchors.bottom: parent.bottom
            AText{
                id: phonetext
                visible: true
                anchors.verticalCenter: parent.verticalCenter
                font.pointSize: is_PCScreen ? 12 :  14
                elide: Text.ElideRight
                wrapMode: Text.NoWrap
                color: "#808080"
                width: parent.width
                text:"在线"
            }
        }
    }
    Item{
        height:parent.height
        width: 0.6*m_lineValue
        anchors.right: menuBtn.left
        anchors.rightMargin: 0.2*m_lineValue
        Image{
            id:imgMute
            anchors.centerIn: parent
            sourceSize: Qt.size(0.5*m_lineValue,0.5*m_lineValue)
            source: "qrc:/images/meeting/jingyin3.svg"
        }
    }
    Item{
        id:menuBtn
        height:parent.height
        width: 0.6*m_lineValue
        anchors.right: parent.right
        anchors.rightMargin: 0.4*m_lineValue
        Image{
            id:imgbottom
            anchors.centerIn: parent
            sourceSize: Qt.size(0.6*m_lineValue,0.6*m_lineValue)
            source: "qrc:/images/menu.svg"
            MouseArea{
                anchors.fill: parent
                onClicked: {
                    menuclickSignal()
                }
            }
        }
    }
}

